import 'package:bubbles/app/main/main_app.dart';
import 'package:bubbles/app/main/main_binding.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../app/home/home_binding.dart';
import '../app/home/home_page.dart';

class RouteManager {
  // 定义初始路由
  static const String initial = '/';

  // 定义所有路由
  static final List<GetPage<dynamic>> routes = [
    // 首页(推荐)
    // CustomGetPage(name: initial, page: () => const HomePage(),binding:HomeBinding()),
    GetPage(name: initial, page: () => const MainApp(), binding: MainBinding()),
  ];
}

class CustomGetPage extends GetPage<dynamic> {
  CustomGetPage({
    required super.name,
    required super.page,
    Bindings? binding,
    bool? fullscreen = false, // 默认值设定
    super.transitionDuration,
  }) : super(
          curve: Curves.linear,
          transition: Transition.native,
          showCupertinoParallax: false,
          popGesture: false,
          binding: binding,
          fullscreenDialog: fullscreen ?? false, // 使用 ?? 运算符处理 null
        );
}
